/**
 * @file SdkPlayButton test cases
 * 播放SDK组件
 * @author wangwei.velvet
 */
let src = 'https://sf1-ttcdn-tos.pstatp.com/obj/developer/sdk/1534422848153.mp4';
let poster = 'https://s3.pstatp.com/toutiao/static/img/logo.201f80d.png';
let poster1 = 'https://img-blog.csdnimg.cn/20210705113753337.jpeg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xwbGo3MTc=,size_16,color_FFFFFF,t_70';
let three_partycloud = 'https://other.d.ireader.com/group81/zi/6L/196066bcccdc77095b5ab964decb149b.mp4?v=agnFey2j&t=fwAAAWUo240.'

exports.svideoPlayer = [
    {
        tplType: 'svideo-player-dyy-zyk',
        desc: '资源库视频,通过resource-id和seq-id播放正常',
        operation: "打开组件正常加载视频,封面图为桂林山水,点击播放按钮视频播放正常",
        expectUI: ['视频可以正常播放'],
        level: "P0",
        params: {
            resourceId: 'R7375368855327310348',
            seqId: '1',
            poster: poster1,
            cloudType: 1,
        },
        button: true
    },
    {
        tplType: 'svideo-player-dyy-ae',
        desc: '内容库视频,通过albumId和episodeId播放正常',
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['视频可以正常播放'],
        level: "P0",
        params: {
            preAction: {
                apiName: 'preLoadVideo',
                args: {
                    albumId: '7322008441361269267',
                    episodeId: '7322008809180774953',
                    cloudType: 1,
                    version: '1'
                },
            },
            albumId: '7322008441361269267',
            episodeId: '7322008809180774953',
            cloudType: 1,
            version: '1'
        },
        button: true
    },
    {
        tplType: 'svideo-player-sfy-ae',
        desc: '三方云方式播放正常',
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['视频可以正常播放'],
        level: "P0",
        params: {
            albumId: '7306039382682239538',
            episodeId: '7306039406861910538',
            cloudType: 2,
            three_party_cloud: three_partycloud,
            version: 1
        },
        button: true
    },
    {
        tplType: 'svideo-player-src',
        desc: 'SRC播放模式,视频播放正常',
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['视频可以正常播放'],
        level: "P0",
        params: {
            src: src
        },
        button: true
    },
    {
        tplType: 'svideo-player-de',
        desc: 'definition播放模式,视频播放正常',
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['视频可以正常播放'],
        level: "P0",
        params: {
            definition: {
                list: [
                    {
                        name: "480P",
                        url: 'https://sf1-ttcdn-tos.pstatp.com/obj/developer/sdk/1534422848153.mp4'
                    }
                ]
            }
        },
        button: true
    },
    {
        tplType: 'svideo-player-ddy-bai',
        desc: '验证组件百分比比例展示',
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['展示对应比例'],
        level: "P1",
        params: {
            albumId: '7299006089373155877',
            episodeId: '7299006327928717851',
            cloudType: 1,
            version: '1',
            style: 'width: 50%;height: 50%;'
        },
        button: true
    },
    {
        tplType: 'svideo-player-ddy-px',
        desc: '验证组件px比例展示',
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['展示对应比例'],
        level: "P1",
        params: {
            albumId: '7299006089373155877',
            episodeId: '7299006327928717851',
            cloudType: 1,
            version: '1',
            style: 'width: 100px;height: 100px;'
        },
        button: true
    },
    {
        tplType: 'svideo-player-ddy-vwh',
        desc: '验证组件vm比例展示',
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['展示对应比例'],
        level: "P1",
        params: {
            albumId: '7299006089373155877',
            episodeId: '7299006327928717851',
            cloudType: 1,
            version: '1',
            style: 'width: 10vh;height: 10vw;'
        },
        button: true
    },
    
    

    {
        tplType: 'svideo-player-dyy-src',
        desc: '[bindgetsource],验证事件触发正常',
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['视频可以正常播放'],
        level: "P0",
        params: {
            albumId: '7299006089373155877',
            episodeId: '7299006327928717851',
            cloudType: 1,
            version: '1'
        },
        eventInfo: {
            eventList: ['bindgetsource'],
            eventParam: {
                type: 'getsource',
                detail: {
                    
                }
            }
          },
        button: true
    },
    {
        tplType: 'svideo-player-ae',
        desc: "短剧一期aid&eid播放模式,视频播放正常",
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['视频可以正常播放'],
        level: "P0",
        params: {
            albumId: '7223330831010529849',
            episodeId: '7223348557599179301',
            cloudType: 1,
        },
        button: true
    },   
    {
        tplType: 'svideo-player-need-modify',
        desc: "aid&eid播放模式,视频需修改状态播放",
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['视频可以正常播放（需修改状态）'],
        level: "P0",
        params: {
            albumId: '7221455349855814202',
            episodeId: '7221456158429872699'
        },
        button: true
    },
    {
        tplType: 'video-panel',
        desc: '[poster=开发者上传短剧图片请求返回的地址',
        expectUI: ['点击按钮展示短剧对应封面图，点击播放按钮正常播放短剧'],
        level: "P0",
        button: true,
        params: [
            {
                src: src,
                poster: 'https://img-blog.csdnimg.cn/20210705113753337.jpeg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2xwbGo3MTc=,size_16,color_FFFFFF,t_70'
            }
        ]
    },
    {
        tplType: 'svideo-player-error6',
        desc: '无网络点击组件的情况',
        operation: "在断网情况下打开组件,点击播放按钮视频播放失败",
        expectUI: ['视频预期播放失败'],
        level: "P2",
        params: {
            poster: poster,
            albumId: '7211038997756248591',
            episodeId: '7211039011559866913'
        },
        eventInfo: {
            eventList: ['binderror'],
            eventParam: {
                type: 'error',
                detail: {
                    errMsg: 'network not available',
                    errNo: 156705,
                    errLogId: ''
                }
            },
        },
        button: true
    },
    {
        tplType: 'svideo-player-ddy-uniapp',
        desc: '验证play,end,pause事件触发成功',
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['依次触发play,pause,play,ended'],
        level: "P1",
        params: {
            albumId: '7299006089373155877',
            episodeId: '7299006327928717851',
            cloudType: 1,
            version: '1'
        },
        eventInfo: {
            eventList: ['play', 'pause', 'play', 'ended'],
            eventParam: {
                type: 'play',
                detail: {
                    
                }
            }
          },
        button: true
    },
    
//-------------------video补充case------------------------
    {
        tplType: 'svideo-player-ddy-alss',
        desc: '验证组件自动播放&循环播放',
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['①触发自动播放和播放至尾部循环播放;②展示全屏按钮;③全屏后不展示播放按钮'],
        level: "P1",
        params: {
            albumId: '7299006089373155877',
            episodeId: '7299006327928717851',
            cloudType: 1,
            version: '1',
            autoplay: true,
            loop: true,
            showFullscreenBtn: true,
            showplaybtn: false
        },
        button: true
    },
    {
        tplType: 'svideo-player-dyy-objectFit',
        desc: '[object-fit] 视频源比例>组件比例',
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['展示3个video组件', '第一个视频左右有黑边', '第二个视频被拉伸铺满播放窗口', '第三个视频被放大'],
        level: "P1",
        params: [
            {
                albumId: '7322008441361269267',
                episodeId: '7322008809180774953',
                cloudType: 1,
                version: '1',
                objectFit: 'contain',
                style: 'width: 360px;height: 280px;'
            },
            {
                albumId: '7322008441361269267',
                episodeId: '7322008809180774953',
                cloudType: 1,
                version: '1',
                objectFit: 'fill',
                style: 'width: 360px;height: 280px;'
            },
            {
                albumId: '7322008441361269267',
                episodeId: '7322008809180774953',
                cloudType: 1,
                version: '1',
                objectFit: 'cover',
                style: 'width: 360px;height: 280px;'
            },
        ],
        button: true
    },
    {
        tplType: 'svideo-player-dyy-pvv',
        desc: '验证播放按钮位置，非全屏手势，全屏手势',
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['播放按钮在视频正中间，非全屏手势操作开启，例如左侧滑动亮度变化，全屏手势操作禁止'],
        level: "P1",
        params: {
            albumId: '7322008441361269267',
            episodeId: '7322008809180774953',
            cloudType: 1,
            version: '1',
            playBtnPosition: 'center',
            vslideGesture: true,
            vslideGestureInFullscreen: false
        },
        button: true
    },
    {
        tplType: 'svideo-player-dyy-eemssde',
        desc: '验证进度手势、播放手势、静音播放、静音、倍速播放、视频方向、小窗播放',
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['①进度手势{屏幕滑动}开启,播放手势{屏幕双击}开启；②静音播放开启,显示静音按钮；③显示倍数播放按钮；④全屏后顺时针旋转90度变成全屏；⑤小窗播放开启{小程序后台,小窗口播放}'],
        level: "P1",
        params: {
            albumId: '7322008441361269267',
            episodeId: '7322008809180774953',
            cloudType: 1,
            version: '1',
            enableProgressGesture: true,
            enablePlayGesture: true,
            muted: true,
            showMuteBtn: true,
            showPlaybackRateBtn: true,
            direction: -90,
            enablePlayInBackground: true
        },
        button: true
    },
    {
        tplType: 'svideo-player-dyy-sis',
        desc: '验证水印、初始播放进度、锁屏按钮',
        operation: "打开组件正常加载视频,点击播放按钮视频播放正常",
        expectUI: ['①确认视频水印；②确认初始进度是从50s开始；③确认全屏效果下，播放界面右侧出现锁屏按钮'],
        level: "P1",
        params: {
            albumId: '7322008441361269267',
            episodeId: '7322008809180774953',
            cloudType: 1,
            version: '1',
            signature: {
                enable: true,
                content: '测试使用',
            },
            initialTime: 50,
            showScreenLockButton: true
        },
        button: true
    },
    {
        tplType: 'svideo-player-dyy-bindtimeupdate',
        desc: '[bindtimeupdate] 视频自动播放，事件校验通过',
        expectUI: ['视频自动播放,点击暂停'],
        level: "P1",
        params: {
            albumId: '7322008441361269267',
            episodeId: '7322008809180774953',
            cloudType: 1,
            version: '1',
            autoplay: true
        },
        eventInfo: {
            eventList: ['timeupdate_n', 'pause'],
            eventParam: {
                type: 'timeupdate'
            }
        },
        button: true
    },
    {
        tplType: 'svideo-player-dyy-bindprogress',
        desc: '[bindprogress]短视频缓冲进度更新 触发此事件正确',
        expectUI: ['视频自动播放', '点击暂停，事件触发正确'],
        level: "P1",
        params: {
            albumId: '7322008441361269267',
            episodeId: '7322008809180774953',
            cloudType: 1,
            version: '1',
            autoplay: true
        },
        eventInfo: {
            eventList: ['progress', 'pause'],
            eventParam: {
                type: 'progress',
                detail: {
                    buffered: 'number'
                }
            }
        },
        button: true
    },
    {
        tplType: 'svideo-player-dyy-bindfullscreenchange',
        desc: '[bindfullscreenchange] 视频暂停切换全屏，事件校验通过',
        expectUI: ['播放视频', '暂停视频', '切换全屏'],
        level: "P1",
        params: {
            albumId: '7320212175116337683',
            episodeId: '7320212658006065703',
            cloudType: 1,
            version: '1',
            showfullscreenbtn: true 
        },
        eventInfo: {
            eventList: ['play', 'pause', 'tt-fullscreenchange_n'],
            eventParam: {
                type: 'tt-fullscreenchange'
            }
        },
        button: true
    },
    {
        tplType: 'svideo-player-dyy-waiting',
        desc: '[bindwaiting] 视频播放，事件校验通过',
        expectUI: '播放视频后拖动进度条，事件校验通过',
        level: 'P1',
        params: {
            albumId: '7322008441361269267',
            episodeId: '7322008809180774953',
            cloudType: 1,
            version: '1',
            autoplay: true
        },
        button: true,
        eventInfo: {
            eventList: ['waiting'],
            eventParam: {
                type: 'waiting',
            }
        }
    },
    // {事件不支持
    //     tplType: 'svideo-player-dyy-bindloadedmetadata',
    //     desc: '[bindloadedmetadata] 视频自动播放，事件检验通过',
    //     expectUI: ['视频自动播放', '事件触发正确'],
    //     level: 'P1',
    //     params: {
    //         albumId: '7322008441361269267',
    //         episodeId: '7322008809180774953',
    //         cloudType: 1,
    //         version: '1',
    //         autoplay: true
    //     },
    //     button: true,
    //     eventInfo: {
    //         eventList: ['loadedmetadata'],
    //         eventParam: {
    //             type: 'loadedmetadata',
    //             detail: {
    //                 width: 'number',
    //                 height: 'number',
    //                 duration: 'number'
    //             }
    //         }
    //     }
    // },
    {
        tplType: 'svideo-player-dyy-bindseekcomplete',
        desc: '[bindseekcomplete] seek视频，事件检验通过',
        expectUI: ['点击播放', '手动拖进度到中间', '手动拖进度到开头', 'position返回正确'],
        level: 'P1',
        params: {
            albumId: '7322008441361269267',
            episodeId: '7322008809180774953',
            cloudType: 1,
            version: '1'
        },
        button: true,
        eventInfo: {
            eventList: ['play','pause','seekcomplete'],
            eventParam: {
                type: 'seekcomplete',
                detail: {
                    position: 'number'
                }
            }
        },
    },
    {
        tplType: 'svideo-player-dyy-bindplaybackratechange',
        desc: '[bindplaybackratechange] 倍速改变，事件校验通过',
        expectUI: ['点击播放', '切换倍速到2.0', '切换倍速到1.0', '点击暂停', '事件触发正确'],
        level: 'P0',
        params: {
            albumId: '7322008441361269267',
            episodeId: '7322008809180774953',
            cloudType: 1,
            version: '1',
            autoplay: false,
            showPlaybackRateBtn: true
        },
        button: true,
        eventInfo: {
            eventList: ['play', 'playbackratechange_n', 'pause'],
            eventParam: {
                type: 'playbackratechange',
                detail: {
                    playbackRate: 'number'
                }
            }
        }
    },
    {
        tplType: 'svideo-player-dyy-bindmutechange',
        desc: '[bindmutechange] 静音状态改变，事件校验通过',
        expectUI: ['默认非静音,点击播放', '点击静音', '点击非静音', '点击暂停', '事件触发正确'],
        level: 'P1',
        params: {
            albumId: '7322008441361269267',
            episodeId: '7322008809180774953',
            cloudType: 1,
            version: '1',
            autoplay: false,
            showMuteBtn: true
        },
        button: true,
        eventInfo: {
            eventList: ['play', 'mutechange_n', 'pause'],
            eventParam: {
                type: 'mutechange',
                detail: {
                    isMuted: "boolean"
                }
            }
        }
    },
    {
        tplType: 'svideo-player-dyy-bindcontroltap',
        desc: '[bindcontroltap] 返回当前点击的控件类型校验通过',
        expectUI: ['默认静音 点击播放', '点击暂停','controlType正确'],
        level: 'P1',
        params: {
            albumId: '7322008441361269267',
            episodeId: '7322008809180774953',
            cloudType: 1,
            version: '1',
            showPlaybackRateBtn: true,
            muted: true,
            showMuteBtn: true
        },
        button: true,
        eventInfo: {
            eventList: ['play','controltap','pause'],
            eventParam: {
                type: 'controltap',
                detail: {
                    controlType: 'string'
                }
            }
        }
    },
    {
        tplType: 'svideo-player-dyy-background',
        desc: '[bindenterbackground] 小窗播放事件',
        operation: ['点击播放视频,切到小窗{后台}播放,点击暂停,返回前台'],
        expectUI: ['事件校验通过'],
        level: 'P1',
        button: true,
        params:
        {
            albumId: '7322008441361269267',
            episodeId: '7322008809180774953',
            cloudType: 1,
            version: '1',
            enablePlayInBackground: true
        },
        eventInfo: {
            eventList: ['play', 'pause', 'enterbackground', 'play', 'pause', 'leavebackground'],
            eventParam: {
                type: 'enterbackground'
            }
        },
    },
    {
        tplType: 'svideo-player-dyy-background',
        desc: '[bindclosebackground] 小窗关闭事件',
        operation: ['iOS使用14以上系统测试，安卓不支持H5方案', '点击播放视频，切到小窗播放时点击关闭，返回前台'],
        expectUI: ['事件校验通过'],
        level: 'P1',
        button: true,
        params:
        {
            albumId: '7322008441361269267',
            episodeId: '7322008809180774953',
            cloudType: 1,
            version: '1',
            enablePlayInBackground: true
        },
        eventInfo: {
            eventList: ['play', 'pause', 'enterbackground', 'play', 'pause', 'closebackground', 'play'],
            eventParam: {
                type: 'closebackground'
            }
        },
    },
    {
        tplType: 'svideo-player-dyy-bindcontrolstoggle',
        desc: '[bindcontrolstoggle] 控件展示变化',
        operation: ['视频区域内点击触发控件的展示和收起'],
        expectUI: ['事件校验依次:控件展示，播放，控件消失，暂停'],
        level: 'P1',
        button: true,
        params:
        {
            albumId: '7322008441361269267',
            episodeId: '7322008809180774953',
            cloudType: 1,
            version: '1'
        },
        eventInfo: {
            eventList: ['controlstoggle','play','pause'],
            eventParam: {
                type: 'controlstoggle',
                detail: {
                    show: true
                }
            }
        },
    },
    // {
    //     tplType: 'svideo-player-dyy-ssd',
    //     desc: '[show-progress][show-bottom-progress][duration-limit] ',
    //     operation: [''],
    //     expectUI: ['新属性目前不支持'],
    //     level: 'P1',
    //     button: true,
    //     params:
    //     {
    //         albumId: '7322008441361269267',
    //         episodeId: '7322008809180774953',
    //         cloudType: 1,
    //         version: '1',
    //         showbottomprogress: false,
    //         durationLimit: 1
    //     },
    // },
];